﻿
/**
A collection of Boolean utility functions.
*/

package com.extra_archive.framework.utils {

	public class BooleanUtils {
	
		/**
		Attempts to convert a String or Number to a native Boolean.
		*/
		public static function getBoolean ( inValue:Object ) : Boolean {
	
			switch( inValue ) {
	
				case true :
				case "on" :
				case "true" :
				case "yes" :
				case "1" :
				case 1 :
	
					return true;
					break;
	
				case "off" :
				case "false" :
				case "no" :
				case "0" :
				case 0 :
	
					return false;
					break;
	
				default :
	
					return false;
					break;
	
			}
		}
	}
}